/***************************************************************************
   Filename:    Paddle.cpp
   Authors:     Josh Partridge and Joe Flowers
   Description: Contains the Paddle class
****************************************************************************/

#ifndef PADDLE_H_INCLUDED
#define PADDLE_H_INCLUDED

#include "boxgen.h"
#include "Brush.h"

class Paddle
{
    private:
        //stores left, right, top, bottom values
        RECT bounds;

        //this way we can affect the ball's trajectory with movement of the paddle
        int velocity;
        //keeping track of this helps us make redrawing the paddle more efficient
        int acceleration;
        //limit the paddle's velocity in either direction
        int max_vel;

    public:
        /************************************************************************************
         Name:               Paddle - default constructor
         Description:        initialize attributes of Ball
        *************************************************************************************/
        Paddle();

        /************************************************************************************
         Name:               setPosition
         Description:        moves bounds RECT based on left side x position
         Input:
                          x: int representing new x position of left bound
        *************************************************************************************/
        void setPosition(int x);

        /************************************************************************************
         Name:               getPosition
         Description:        getter left side x position
         Output:
                     return: integer representing left side x position
        *************************************************************************************/
        int getPosition();

        /************************************************************************************
         Name:               setVelocity
         Description:        setter for velocity
         Input:
                          v: int representing new velocity
        *************************************************************************************/
        void setVelocity(int v);

        /************************************************************************************
         Name:               getVelocity
         Description:        getter velocity
         Output:
                     return: integer representing velocity
        *************************************************************************************/
        int getVelocity();

        /************************************************************************************
         Name:               setAcc
         Description:        setter for acceleration, parameter depends on which key pressed
         Input:
                          a: int representing new acceleration
        *************************************************************************************/
        void setAcc(int a);

        /************************************************************************************
         Name:               redraw
         Description:        applies velocity to position and draws, doesn't draw if the
                             paddle doesn't or can't move.
         Input:
                     brush: reference to Game's pointer to main's brush
        *************************************************************************************/
        void redraw(Brush&);

        /************************************************************************************
         Name:               draw
         Description:        called by draw when it is ready to actally draw
         Input:
                     brush: reference to Game's pointer to main's brush
                     force: bool representing whether to not check velocity or validate position
        *************************************************************************************/
        void draw(Brush& brush, bool force=false);
};

#endif // PADDLE_H_INCLUDED
